#include "vecm.h"
#include "vector3.h"

#pragma once
class Point
{
public:
	Point(){}
	Point(float x,float y,float z)
	{
		this->x=x;
		this->y=y;
		this->z=z;
	}
	Point(vec4 v)
	{
		if(v.w==0)
			throw std::logic_error("Cannot convert a vector to point.");

		this->x=v.x;
		this->y=v.y;
		this->z=v.z;
	}

	float x;
	float y;
	float z;

	vector3 toVector() const
	{
		return vector3(x,y,z);
	}

	operator vec4() const
	{
		return vec4(this->x,this->y,this->z,1);
	}

	vector3 operator - (const Point& p) const
	{
		return vector3(x-p.x,y-p.y,z-p.z);
	}
};

